package com.deli.core.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.deli.core.dao.SkuDAO;
import com.deli.core.pojo.Sku;
import com.github.abel533.entity.Example;
@Service("skuService")
public class SkuServiceImpl implements SkuService {

	@Autowired
	private SkuDAO skuDAO;
	@Override
	public List<Sku> findSkuById(Long productId) {
		Example example = new Example(Sku.class);
		example.createCriteria().andEqualTo("productId", productId);
		
		return skuDAO.selectByExample(example);
	}
	@Override
	public int updateById(Sku sku) {
		
		return skuDAO.updateByPrimaryKeySelective(sku);
	}

}
